<template>
  <div class="home">
    <router-view class="content-box"></router-view>
    <ul>
      <router-link custom to="/" v-slot="{navigate, isExactActive}">
        <li @click="navigate" :class="{active: isExactActive}">首页</li>
      </router-link>
       <router-link custom to="/type" v-slot="{navigate, isExactActive}">
        <li @click="navigate" :class="isExactActive ? 'active' : ''">分类</li>
      </router-link>
       <router-link custom to="/cart" v-slot="{navigate, isExactActive}">
        <li @click="navigate" :class="isExactActive ? 'active' : ''">购物车</li>
      </router-link>
      <router-link custom to="/profile" v-slot="{navigate, isExactActive}">
        <li @click="navigate" :class="isExactActive ? 'active' : ''">我的</li>
      </router-link>
    </ul>
  </div>
</template>
<style lang="scss" scoped>
  ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: space-between;
  ;
  li {
  flex-basis: 25%;
  text-align: center;
  line-height: 50px;
  background-color: #fff}
  }
  .content-box {
  width: 100%;
  height: calc(100% - 50px);
  overflow-x: hidden;
  overflow-y: auto;}
  .active {
  background-color: green;
  color: #fff;}
</style>
